package com.ljw.community.mapper;

import com.ljw.community.entity.Admin;
import com.ljw.community.service.SqlService;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface AdminMapper {

    @Select(value = "select * from admin where login_name = #{loginName} and del_flag = 0")
    Admin getByLoginName(String loginName);

    @SelectProvider(method = "countProvider", type = SqlService.class)
    int count(String query, String type);

    @Update(value = "update admin set password = #{newPwd} where login_name = #{loginName}")
    int modifyPwdByLoginName(String newPwd,String loginName);
}
